#import "NSMutableArray+category.h"
@implementation NSMutableArray (category)
- (void)yjd_enumerate:(NSDictionary *)dict
{
    NSString *jsonString = [dict json];
    if ([self count] > 0)
    {
        __block BOOL containt = NO;
        [self enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            NSString *objString = (NSString *)obj;
            NSMutableDictionary *oldDict = [NSMutableDictionary dictionaryWithDictionary:[objString dict]];
            NSString *oldKey = [[oldDict allKeys] firstObject];
            NSString *newKey = [[dict allKeys] firstObject];
            if ([newKey isEqualToString:oldKey])
            {
                containt = YES;
                [oldDict setObject:[dict objectForKey:newKey] forKey:oldKey];
                NSString *newJsonString = [oldDict json];
                [self removeObject:obj];
                [self insertObject:newJsonString atIndex:0];
                *stop = YES;
            }
        }];
        if (containt == NO)
        {
            [self insertObject:jsonString atIndex:0];
        }
    }
    else
    {
        [self addObject:jsonString];
    }
}
@end
